import { INCREMENT, DECREMENT } from '../constant';
// import { createSlice } from "@reduxjs/toolkit";

const initialState = 0;
export default function countReducer(preState = initialState, action) {
    const { type, data } = action;
    switch (type) {
        case INCREMENT:
            return preState + data;
        case DECREMENT:
            return preState - data;
        default:
            return preState;
    }
}

// const couontCreateSlice = createSlice({
//     name: "counter",
//     initialState,
//     reducers: {

//     }
// })